<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>药房领药</title>
</head>
<body>
<script type="text/javascript">
	$(function(){
		/* 打开窗口 */
		$("#yzr-addpick-med-btn").linkbutton({onClick: function(){			
			var yzr_addMedDraw_stored = $("#yzr-pick-pharmacy").combogrid("getValue");
			if(yzr_addMedDraw_stored == ''){
				$.messager.alert("提示", "请选择药房！");
			}else{
				$("#yzr-selectMed-medpick-window").window("open");
				$("#tb-medpick-selectMed").datagrid({
		    		url: '', 
		    		queryParams: {
		    			cangku: yzr_addMedDraw_stored
		    		},
		    		method: 'get'
		    	});
			} 
		}});
		
		
		//显示全部
		$("#yzr-selectMed-medDraw-reload").linkbutton({onClick:function(){
			var yzr_addMedDraw_stored = $("#yzr-addMedDraw-stored").combogrid("getValue");
			$("#tb-medDraw-selectMed").datagrid({
	    		url: 'queryMedByStore_yzr', 
	    		queryParams: {
	    			cangku: yzr_addMedDraw_stored
	    		},
	    		method: 'get'
	    	});			
		}});
			
			
		//搜索
		$('#yzr-selectMed-medDraw-search').searchbox({
		    searcher:function(value,name){
		    	var yzr_addMedDraw_stored = $("#yzr-addMedDraw-stored").combogrid("getValue");
		    	if(value == ''){
		    		$.messager.alert("提示", "请输入查询条件！");
		    	}else{
		    		$("#tb-medDraw-selectMed").datagrid({	    		
			    		url: 'queryMedByName_yzr',
			    		method: 'post', 
			    		queryParams: {
			    			page:1,
			    			rows:13,
			    			medName: value,
			    			cangku: yzr_addMedDraw_stored
			    	}});
		    		$('#yzr-selectMed-medDraw-search').searchbox('setValue', '');
		    	}		    	
		    }
		});
	})
</script>





	<form style="padding:15px;background:#ECF3FF;">
		<table style="width:100%">
			<tr>
				<td style="width:35%;">
					<select id="yzr-pick-object" class="easyui-combobox" data-options="
					   		label: '领用对象',
							labelAlign:'right',
							required:true,
							width: '90%',
							panelWidth: '150',
							panelHeight: 'auto'">
					    <option value="科室">科室</option>
					    <option value="护士">护士</option>
					</select>
				</td>
				<td style="width:33%;">
					<select class="easyui-combogrid" id="yzr-pick-pharmacy"
							data-options="
								label: '药房',
								labelAlign:'right',
								required:true,
								width: '90%',
								panelWidth: '290',
								panelHeight: 'auto',
								url: 'queryAllPharmacy',
								pagination: true,
								pageSize: 8,
								pageList: [8, 16, 24, 32],
								idField: 'pharmacyId',
								textField: 'pharmacyName',
								columns: [[				
									{field:'pharmacyName',title:'药房名',width:100},
									{field:'staffName',title:'负责人',width:85},
									{field:'pharmacyAddress',title:'地址',width:100}
								]]
						"></select>
				</td>
				<td style="width:32%;"></td>
			</tr>
			<tr>
				<td>
					<input id="yzr-pick-medName" class="easyui-textbox" data-options="required:true,width: '75%',labelAlign:'right',label:'药品'"/>
					<a id="yzr-addpick-med-btn" href="#" class="easyui-linkbutton" data-options="width: '23%',iconCls:'icon-search'">查找</a>
				</td>

				<td>
					<input id="yzr-pick-pihao" class="easyui-textbox" data-options="required:true,width: '90%',labelAlign:'right',label:'批号'"/>
				</td>
				<td>
					<!-- <input id="yzr-pick-unit" class="easyui-textbox" data-options="required:true,width: '95%',labelAlign:'right',label:'单位'"/> -->
				</td>
			</tr>
			<tr>
				<td>
					<input id="yzr-pick-number" class="easyui-numberbox" data-options="required:true,width: '90%',labelAlign:'right',label:'数量'"/>
				</td>
				<td>
					<input id="yzr-pick-remark" class="easyui-textbox" data-options="required:true,width: '90%',labelAlign:'right',label:'说明'"/>
				</td>
				
				<td>
					<a id="yzr-addpick-addbtn" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-add'">添加</a>
					<a id="yzr-addpick-cancelbtn" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-cancel'">删除</a>
				</td>
				
			</tr>
		</table>
	</form>
	
	<!-- 领取药品 -->
	<div style="margin: 20px;">
		<div id="yzr-medpick-med-tabs" class="easyui-tabs" style="width:100%; margin-top:0px;" data-options="plain:true,narrow:true">
			<div title="提领药品" style="padding:10px;">
					<table id="yzr-medpick-med-dg" class="easyui-datagrid" 
							data-options="
								iconCls: 'icon-edit',
								singleSelect:true,	
								toolbar: '#yzr-medpick-med-tb',							
								width: '98%'
								">
							<thead>
								<tr><!--领用详情编号，领用单编号，药品编号，药品名，批号，领用数量，说明
								pharPickDetId,pharPickDetBatchnumber,pharPickDetMedId,pharPickDetMedName,pharPickDetPickId,
								pharPickDetPickNumber,pharPickDetRemark
								-->
									<th data-options="field:'pharPickDetMedId',width:'20%',align:'center'">药品编号</th>			
									<th data-options="field:'pharPickDetMedName',width:'20%',align:'center'">药品名称</th>
									<th data-options="field:'pharPickDetBatchnumber',width:'20%',align:'center'">批号</th>
									<th data-options="field:'pharPickDetUnit',width:'11%',align:'center'">单位</th>
									<th data-options="field:'pharPickDetPickNumber',width:'11%',align:'center'">领取数量</th>
									<th data-options="field:'pharPickDetRemark',width:'15%',align:'center'">说明</th>
								</tr>
							</thead>
					</table>
					
					<div id="yzr-medpick-med-tb">								
						<a id="yzr-medpick-med-tijiao" href="#" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-ok'">提交</a>			
					</div>
			 </div>
			 
			 <div title="查看详情">
				tab2
		    </div>						
		</div>						
	</div>
	
	
	<!-- 选择药品窗口 -->
	<div id="yzr-selectMed-medpick-window" class="easyui-window" title="选择提领药品" style="width:850px;height:350px;" data-options="closable:true,closed:true,collapsible:false,minimizable:false,maximizable:false">
		<table id="tb-medpick-selectMed" class="easyui-datagrid"
			data-options="				
				fit:true,
				pagination: true,
				pageSize: 8,
				pageList: [8, 16, 24, 32],
				rownumbers: false,
				toolbar: '#yzr-selectMed-medpick-tb',
				border:false,
				singleSelect:true
			">
			<thead>
				<tr>	
				<!-- 库存编号，仓库编号，药品编号，药品名，批号，类型（中药，西药），规格，单位，单价，数量，金额	
				//medStockId,medStockBatchnumber,medStockGuige,medStockMedId,medStockMedKind,medStockMedName,medStockMoney,
				//medStockNumber,medStockPrice,medStockStoreId,medStockUnit -->
					<!-- <th data-options="field:'medStockId',width:'15%',align:'center'">库存编号</th> -->
					<th data-options="field:'storeName',width:'18%',align:'center'">药房</th>
					<th data-options="field:'medStockMedId',width:'18%',align:'center'">药品编号</th>
					<th data-options="field:'medStockMedName',width:'18%',align:'center'">药品名</th>
					<th data-options="field:'medStockMedKind',width:'10%',align:'center'">类型</th>	
					<th data-options="field:'medStockBatchnumber',width:'10%',align:'center'">批号</th>					
					<th data-options="field:'medStockGuige',width:'10%',align:'center'">规格</th>	
					<th data-options="field:'medStockUnit',width:'8%',align:'center'">单位</th>		
					<th data-options="field:'medStockNumber',width:'10%',align:'center'">数量</th>
					<th data-options="field:'medStockPrice',width:'10%',align:'center',hidden:true">单价</th>									
				</tr>
			</thead>
		</table>				    
		    
		<div id="yzr-selectMed-medpick-tb">
			<input id="yzr-selectMed-medpick-search" class="easyui-searchbox" data-options="menu: '#yzr-selectMed-medpick-pName', width: 220, prompt: '请输入关键字'"/>
			<a id="yzr-selectMed-medpick-reload" class="easyui-linkbutton" data-options="iconCls:'icon-reload'">刷新</a>
			<a id="yzr-ok-btn-medpick-selectMed" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-ok'" style="margin-left:475px;">确定</a>			
		</div>
		
		<div id="yzr-selectMed-medpick-pName" style="width:140px">
		    <div data-options="name:'name'">药品名称</div>
		</div>
	</div>	
</body>
</html>